home *** CD-ROM | disk | FTP | other *** search
/ PC-SIG Library 8 / PC-SIG Library CD-ROM (8th Edition) (1990-04).iso / 201_300 / disk0258 / ring.bas < prev    next >
Encoding:
BASIC Source File  |  1984-05-08  |  2.0 KB  |  55 lines

  1. 10 'RING.BAS   2/20/84  (See also info at LINE 300)
  2. 20 'This program (along with a BATCH file) to look for an incoming
  3. 30 'call on a HAYES and then switch system control to the COM1:
  4. 40 'port. By calling the batch file "OUTSIDER" the system
  5. 50 'can return to looking for another outside call. Control can
  6. 60 'be returned to the keyboard by BREAKing this program, returning to
  7. 70 'the SYSTEM and pressing CTRL-BREAK (real quick)!
  8. 80 '
  9. 90 'This program is freely given to the public domain.
  10. 100 'Developed by Dan Derrick under a grant from Direct Access
  11. 110 '
  12. 120 ON ERROR GOTO 800
  13. 130 CLS
  14. 140   PRINT"Your computer will be ready to receive external control in"
  15. 141 FOR X=9 TO 1 STEP -1
  16. 143   LOCATE 2,1
  17. 150   PRINT X;"seconds."
  18. 152   FOR Y=1 TO 1000:NEXT Y
  19. 155 NEXT X
  20. 170 CLS
  21. 180 OPEN "COM1:300,E,7,1" AS #1
  22. 190     PRINT#1,"AT S0=1"            'sets up for auto answer mode
  23. 200       INPUT#1,A$                 'looks for local "RING" response
  24. 210       IF A$<>"RING" THEN 200
  25. 220   FOR P=1 TO 3000:NEXT P         'pause to wait for carrier tone
  26. 230       PRINT#1,"You have the system"
  27. 240       PRINT#1,"All commands are now at the DOS level."
  28. 250       PRINT#1,"Type OUTSIDER to return the SYSTEM"
  29. 260       PRINT#1,"to waiting for an incoming RING."
  30. 270   CLS:SYSTEM
  31. 280 CLOSE:GOTO 180
  32. 290 '
  33. 300 'This program is part of a BATCH file.
  34. 310 'It must be called from the BATCH file to work:
  35. 320 'Type  RUN 500  to create this BATCH file
  36. 330 '
  37. 500 ON ERROR GOTO 800
  38. 505 OPEN "I",#2,"outsider.bat":CLOSE:PRINT "File exists":GOTO 570
  39. 506 OPEN "o",#2,"outsider.bat"
  40. 510 PRINT#2,"REM PRESS KEY, THEN HANG UP"
  41. 520 PRINT#2,"PAUSE"
  42. 530 PRINT#2,"CTTY CON"
  43. 540 PRINT#2,"BASICA RING"
  44. 550 PRINT#2,"CTTY COM1"
  45. 560 CLOSE#2
  46. 570 PRINT"Now go back to the SYSTEM level and type OUTSIDER"
  47. 580 PRINT "Press any key to do this or CTRL-BREAK to stop"
  48. 590 A$=INKEY$:IF A$="" THEN 590
  49. 600 SYSTEM
  50. 800 IF ERR=57 THEN 280
  51. 810 IF ERR=53 THEN 506
  52. 820 PRINT "FATAL ERROR....SORRY"
  53. 999 END
  54. 1000 '********* PHYSICAL END EOF *********
  55.